<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //let a = 1, b = 2, c = 3;
        // let [a,[b,c],d,e] = [1,[2,3], 4];
        
        // console.log(a,b,c,d,e);
        //let {foo2,bar } = {bar:'bbb' ,foo: 'aaa'};


    //     var json = {
    //         name:"张三",
    //         eat: function (){
    //             console.log("吃饭了")
    //         }
    //     }

    //     const {name, sex="男" , eat} = json;
    //  //eat();
    //     console.log(name,sex)

    // let a = 0;
    // let [a] = [1,2];
    // console.log(a);

    // let arr = [1,2,3];
    // let {0:first, 2:last} = arr;
    // console.log(arr)

    // function sum([a=0,b=0]=[]) {
    //     console.log(a + b);
    // }

    // sum();
     

    //数组去重
      //const arr = [1,3,4,2,3,5];
    //   const newArr = [];
    //   for (let i = 0; i< arr.length; i++) {
    //       if(newArr.indexOf(arr[i]) <0){
    //           newArr.push(arr[i]);
    //       }
    //   }
    //   console.log(newArr)

    // const s = new Set(arr);
    // const [...newArr] = s;
    // console.log(newArr)



    
    // map k-v
    const map = new Map();
    map.set("name","张三");
    map.set("sex","男");
    map.set("age",20);
    console.log(map)

    for(const item of map) {
        const [k, v] = item;
        console.log(k, v)
    }

    </script>
</head>
<body>
    
</body>
</html>